@use 'utils/variables';

.AdminPanel {
    padding: 0;
    border: solid 1px rgba(var(--center-channel-color-rgb), 0.12);
    border-radius: var(--radius-s);
    margin: 2em 0 1em;
    background-color: var(--center-channel-bg);
    box-shadow: var(--elevation-1);
    font-size: 0.95em;

    .AdminPanel__content {
        padding: 10px 20px 20px;
    }

    .AdminPanel__table {
        width: 100%;

        th {
            border-bottom: solid 1px alpha-color(variables.$black, 0.1);
        }

        td,
        th {
            padding: 6px 20px;

            &:first-child {
                padding-left: 20px;
            }
        }
    }

    .header {
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        padding: 20px;
        border-radius: var(--radius-s) var(--radius-s) 0 0;
        background: variables.$white;

        h3 {
            padding: 0;
            margin: 0;
            font-size: 18px;
            font-weight: normal;
        }

        .button {
            align-self: flex-end;
            margin-left: 10px;

            svg {
                transform: rotate(0deg);
                transition: transform 300ms;
            }
        }
    }

    &.closed {
        .header {
            .button {
                svg {
                    transform: rotate(90deg);
                    transition: transform 300ms;
                }
            }
        }
    }
}

.AdminPanelTogglable {
    .AdminPanelTogglableContent {
        display: grid;
        grid-template-rows: 1fr;
        transition: all 0.4s ease-in-out 0s;
    }

    &.closed {
        .AdminPanelTogglableContent {
            grid-template-rows: 0fr;
        }
    }

    .AdminPanelTogglableContent .AdminPanelTogglableContentInner {
        overflow: hidden;
    }
}
